package leetcode;

public class Q2466 {
    public int countGoodStrings(int low, int high, int zero, int one) {
        int res = 0;
        final int MOD = 1000000007;
        int[] f = new int[high + 1];

        f[0] = 1;

        for (int i = 1; i <= high; i++) {
            if (i >= zero) {
                f[i] = f[i - zero];
            }
            if (i >= one) {
                f[i] = (f[i] + f[i - one]) % MOD;
            }
            if (i >= low) {
                res = (res + f[i]) % MOD;
            }
        }

        return res;
    }

    public static void main(String[] args) {
        Q2466 sl = new Q2466();
        System.out.println(sl.countGoodStrings(5, 5, 2, 4));
        System.out.println(sl.countGoodStrings(3, 3, 1, 1));
        System.out.println(sl.countGoodStrings(2, 3, 1, 2));
        System.out.println(sl.countGoodStrings(200, 200, 10, 1));
    }
}



